import type { ReactElement } from 'react'
import React, { useState, createContext, useContext } from "react";
import type { NextPage } from 'next'
import Layout from '../../../components/layout'
import MainLayout from '../../../components/layout/main'
import Sidbar from '../../../components/layout/sidebar'
import { UserContext } from '../../_app'

export default function Codes() {
  const { name, age } = useContext(UserContext);
  return (
    <div>
      仓库 { name } : { age }
    </div>
  )
}

Codes.getLayout = function getLayout(page: ReactElement) {
  return (
    <Layout>
      <MainLayout>
        <Sidbar>
          {page}
        </Sidbar>
      </MainLayout>
    </Layout>
  )
}